<#macro tablePage>
<div class="text-center">
    <#if page?? && page.totalElements != 0>
        <ul id="page" currentPage="${(page.number+1)!}" totalPages="${(page.totalPages)!}" style="margin: 10px 0"></ul>
        <script type="text/javascript"
                src="${base}/resources/plugs/bootstrap-paginator/0.5/bootstrap-paginator.min.js"></script>
        <script type="text/javascript">
            <!--
            /**
             * 分页信息JS
             */
            function page() {
                var options = {
                    currentPage: $("#page").attr("currentPage"),
                    totalPages: $("#page").attr("totalPages"),
                    numberOfPages: 3,
                    onPageClicked: function (e, originalEvent, type, page) {
                        var $form = $("#page").parents("form");
                        $form.find("input[name='page']").remove();
                        $form.append("<input type='hidden' name='page' value='" + (page - 1) + "'>");
                        $form.append("<input type='hidden' name='sort' value='start_time,desc'>");
                        var cusNameLike = $("input[name='cusNameLike']").val();
                        var phone = $("input[name='phone']").val();
                        var startTime = $("input[name='startTime']").val();
                        var endTime = $("input[name='endTime']").val();
                        var idNo = $("input[name='idNo']").val();
                        var cardNo = $("input[name='cardNo']").val();
                        if (cusNameLike != "") {
                            $form.append("<input type='hidden' name='cusNameLike' value='" + cusNameLike + "'>");
                        }
                        if (phone != "") {
                            $form.append("<input type='hidden' name='phone' value='" + phone + "'>");
                        }
                        if (startTime != "") {
                            $form.append("<input type='hidden' name='startTime' value='" + startTime + "'>");
                        }
                        if (endTime != "") {
                            $form.append("<input type='hidden' name='endTime' value='" + endTime + "'>");
                        }
                        if (idNo != "") {
                            $form.append("<input type='hidden' name='idNo' value='" + idNo + "'>");
                        }
                        if (cardNo != "") {
                            $form.append("<input type='hidden' name='cardNo' value='" + cardNo + "'>");
                        }
                        $form.submit();
                    }
                };
                $('#page').bootstrapPaginator(options);
            }
            $(function () {
                page();
            });
            //-->
        </script>
    <#else>
        <h4>暂无数据！</h4>
    </#if>
</div>
</#macro>
